package a3;
import java.io.*;
import java.io.File;

import a2.Course;
import a2.Student;
import a2.Teacher;

public class Test {
    public static void main(String[] args) throws IOException {
    	PrintStream out = new PrintStream("选课结果.txt");
        System.setOut(out);
        Student me = new Student(2021310845, "a", "man");
        System.out.println("学生信息");
        System.out.println(me);
        Teacher b = new Teacher(86, "b", "woman", "离散数学");
        System.out.println("教师信息");
        System.out.println(b);
        Course c = new Course("离散数学", 86, "教室", 90f);
        System.out.println("课程信息");
        System.out.println(c);
        PrintStream Out = new PrintStream("处理结果.txt");
        System.setOut(Out);
        System.out.println("当前信息为："+"\n");
        File file = new File("D:\\0002" + File.separator + "选课结果.txt");
        Reader r=new FileReader(file);
        BufferedReader br=new BufferedReader(r);
        String str="";
        while((str=br.readLine())!=null){
            System.out.println(str);
        }
        br.close();
        r.close();
        System.out.println("\n"+"进行退课操作.....");
        System.out.println("退课结果为：");
        me.tuike();
        me.delete();

    }
}